import java.util.Scanner;

public class homework05 {
    public static void main(String[] args) {
        /**
         * 录入班级学员的人数，然后循环录入学员名字。之后，输入一个名字，查找该学员是否在此班级中
         */
        Scanner sc = new Scanner(System.in);
        String[] arr = new String[5];
        for (int i = 0; i < arr.length; i++) {
            System.out.println("请输入第" + (i + 1) + "名学员名字:");
            arr[i] = sc.next();
        }
        System.out.println("请输入要查找的学员名字:");
        String name = sc.next();
        int status = existStr(arr, name);
        if (status != -1) {
            System.out.println(name + "学员在此班级");
        } else {
            System.out.println(name + "学员不在此班级");
        }
    }


    public static int existStr(String[] arr, String target) {
        for (int i = 0; i < arr.length; i++) {
            if (target.equals(arr[i])) {
                return i;
            }
        }
        return -1;
    }



}